home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / aix-faq / part1 next >
Encoding:
Internet Message Format  |  1993-06-14  |  62.7 KB

  1. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!usc!cs.utexas.edu!mavrick!basto@cactus.org
  2. From: basto@cactus.org (Luis Basto)
  3. Newsgroups: comp.unix.aix,news.answers,comp.answers
  4. Subject: AIX Frequently Asked Questions (Part 1 of 2)
  5. Summary: This posting contains a list of Frequently Asked Questions 
  6.          and their answers about AIX, IBM's version of Unix.
  7. Keywords: AIX RS/6000 questions answers
  8. Message-ID: <1438@mavrick.UUCP>
  9. Date: 15 Jun 93 06:07:29 GMT
  10. Expires: 15 Jul 93 01:23:45 GMT
  11. Sender: luis@mavrick.UUCP
  12. Reply-To: basto@cactus.org (Luis Basto)
  13. Followup-To: comp.unix.aix
  14. Lines: 1674
  15. Approved: news-answers-request@MIT.Edu
  16. Supersedes: <1432@mavrick.UUCP>
  17. Xref: senator-bedfellow.mit.edu comp.unix.aix:26284 news.answers:9415 comp.answers:1001
  18.  
  19. Archive-name: aix-faq/part1
  20. Last-modified: June 15, 1993
  21. Version: 2.33
  22.  
  23.  
  24. Version: $Id: aix.faq,v 2.33 93/06/15 basto $
  25.  
  26. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  27. _____________________________________________________
  28.  
  29. This posting contains frequently asked questions and answers about the
  30. IBM RS/6000 series workstations and AIX version 3.  All input is very
  31. welcome, please mail to basto@cactus.org.
  32.  
  33. The list is split into two articles so it can pass thru most mailers. 
  34. I'll usually try to post them once a month to comp.unix.aix,
  35. news.answers, and comp.answers.  Please let your input continue as I am
  36. most thankful for all of it.
  37.  
  38. If you see a From: line it means that whatever follows is either an
  39. unabridged or slightly edited version of the input I have received, and
  40. that I may not have verified its contents.  If there is no From: line, I
  41. probably know what I am talking about, and the entry is edited from
  42. various sources.
  43.  
  44. All entries are numbered with major and minor subject number, e.g. 
  45. 3.05.  If the subject is preceded by an asterisk, that entry has been
  46. changed or added since the last posting.
  47.  
  48. The comp.unix.aix group is for AIX on all IBM platforms -- RT, PS/2,
  49. 370, RS/6000 and mainframes (ESA based on OSF/1), but the traffic has
  50. evolved to discuss predominantly AIX 3.x and the RS/6000.  The
  51. newsgroups comp.sys.ibm.pc.rt and comp.sys.ibm.ps2.hardware cover the
  52. RT, mostly hardware and AOS 4.3, and on PS/2 hardware respectively. 
  53. There are few to non-existent discussions on AIX/370 and AIX/ESA.
  54.  
  55. This article covers only AIX 3.x and the RS/6000, except when
  56. specifically noted.
  57.  
  58. If you post questions to comp.unix.aix, please be sure to indicate:
  59.  
  60. - the machine type and brief configuration, e.g. Model 540, 64 MB RAM,
  61.   48 MB swap space (this is actually bad), 1.2 GB XYZ hard drive, etc.
  62.  
  63. - the exact AIX version number, i.e. AIX 3.1 is NOT sufficient, whereas
  64.   AIX 3.1.5 or AIX 3.1 with the 3005 update is.
  65. ______________________________________________________________________________
  66.  
  67. Table of contents:
  68.  
  69. 1.00  The AIX operating system - what is it?
  70. 1.01  I know neither Unix nor AIX - where do I find more information?
  71. 1.02  I am used to Unix systems programming, why should I learn SMIT?
  72. 1.03  What is the Object Database?
  73. 1.04  How do I get rid of the verbose error messages?
  74. 1.05  How do I make an informative prompt in the shell?
  75. 1.06  How do I import an /etc/passwd or /etc/group file from another box?
  76. 1.07  How do I put my own text into InfoExplorer?
  77. 1.08  Who has a termcap/terminfo source for aixterm or the HFT console?
  78. 1.09  Which release of AIX do I have?
  79. 1.10  Cleaning up utmp, who, and accounting problems
  80. 1.11  Other hints, fsck of /, X-windows and ctrl-alt-backspace
  81. 1.12  How do I shrink /usr?
  82. 1.13  How do I shrink the default paging space on hd6?
  83. 1.14  How do I make a filesystem larger than 2 Gig?
  84. 1.15  How do I see/change system parameters like number of processes per user?
  85. 1.16  How can I unmount /usr to run fsck on it?
  86. 1.17  The swapper seems to use extreme amount of paging space, why?
  87. 1.18  How much should I trust the ps memory reports?
  88. 1.19  How do I mount a floppy disk as a filesystem?
  89. 1.20  Some info about tape backups
  90. 1.21  How do I do remote backup?
  91. 1.22  How do I backup a multi-disk volume group?
  92. 1.23  How do I put multiple backups on a single 8mm tape?
  93. 1.24  How do I remove a committed lpp?
  94. 1.25 *My named dies frequently, why?
  95. 1.26  How do I trace ethernet packets on an AIX system?
  96. 1.27  How can I look at PostScript files?  Why is "dpsexec" so lousy?
  97. 1.28  What is the authorized way of starting automount at boot time?
  98. 1.29  InfoExplorer ASCII key bindings 
  99. 1.30  Listing files with ls causes a core dump
  100. 1.31  Where are the AIX log files kept?
  101. 1.32  Two srcmstr's are less useful than one?
  102. 1.33 *Where can I find tools for performance monitoring?
  103. 1.34  How do I set a tty port for both dial-in and dial-out?
  104. 1.35  SCSI-1 and SCSI-2 "interoperability" got you confused?
  105. 1.36  How to move or copy whole directory trees across a network
  106. 1.37  How to get your keyboard back after unplugging it from the 6000
  107. 1.38  How do I set up ksh for emacs mode command line editing?
  108. 1.39  How can I tell what virtual printer a print queue is using?
  109. 1.40  How can I add new man pages to the system?
  110. 1.41  How much paging space do I need?
  111. 1.42  How can I make an exact duplicate of a tape over the network?
  112. 1.43  How do I find a file name from the inode number?
  113. 1.44 *How do I set up postscript accounting?
  114. 1.45 *How do I set up pcsim, the DOS emulator?
  115. 1.46 *How do I transfer files between AIX and DOS disks?
  116. 1.47 *How do I create boot diskettes for 3.2?
  117. 1.48 *Some info about the memory management system
  118. 1.49 *unix:0 vs `hostname`:0
  119.  
  120. 2.00  C/C++
  121. 2.01  I cannot make alloca work
  122. 2.02  How do I compile my BSD programs?
  123. 2.03  Isn't the linker different from what I am used to?
  124. 2.04  How do I link my program with a non-shared /lib/libc.a?
  125. 2.05  How do I make my own shared library?
  126. 2.06  Linking my program fails with strange error, why?
  127. 2.07  What's with malloc()?
  128. 2.08  Why does xlc complain about 'extern char *strcpy()'
  129. 2.09  Why do I get 'Parameter list cannot contain fewer ....'
  130. 2.10  Why does xlc complain about '(sometype *)somepointer = something'
  131. 2.11  Some more common errors
  132. 2.12  Can the compiler generate assembler code?
  133. 2.13  Curses
  134. 2.14  How do I speed up linking?
  135. 2.15  What is deadbeef?
  136. 2.16  How do I statically link in 3.2?
  137.  
  138. 3.00  Fortran and other compilers
  139. 3.01  I have problems mixing fortran and C code, why?
  140. 3.02  How do I statically bind fortran libraries and dynamically bind
  141.       C libraries?
  142. 3.03  How do I check if a number is NaN?
  143. 3.04  Some info sources on IEEE floating point
  144.  
  145. 4.00  GNU and Public Domain software
  146. 4.01  How do I find PD software?
  147. 4.02 *Are there any ftp sites?
  148. 4.03  General hints
  149. 4.04 *GNU Emacs
  150. 4.05 *gcc/gdb
  151. 4.06  GNU Ghostscript
  152. 4.07  TeX
  153. 4.08  Perl
  154. 4.09 *X-Windows
  155. 4.10  bash
  156. 4.11  Elm
  157. 4.12  Oberon 2.2
  158. 4.13  Kermit
  159. 4.14  Gnu dbm
  160. 4.15  tcsh
  161. 4.16  Kyoto Common Lisp
  162. 4.17  Tcl/Tk
  163. 4.18  Expect
  164. 4.19 *Public domain software on CD
  165.  
  166. 5.00  Third party products
  167. 5.01  IBM List of third party products
  168. 5.02  Disk/Tape/SCSI
  169. 5.03  Memory
  170. 5.04  Others
  171. 5.05  C++ compilers
  172.  
  173. 6.00  Miscellaneous other stuff
  174. 6.01  Can I get support by email?
  175. 6.02  List of useful faxes
  176. 6.03  List of 3.2 ptfs
  177. 6.04  Some RS232 hints
  178. 6.05  VT100 key bindings for aixterm
  179. 6.06  What publications are available for AIX and RS/6000?
  180. 6.07  Some acronyms
  181.  
  182. 7.00  How do I get this by mailserver or ftp?
  183. 7.01  Contributors
  184. ______________________________________________________________________________
  185. 1.00: The AIX operating system - what is it?
  186.  
  187. This is best answered by reading the text files in /usr/lpp/bos.  The
  188. README file there contains general information and the bsdadm file
  189. contains useful information if you know BSD and/or SystemV.
  190.  
  191. The last release for the RT PC is 2.2.1. The latest release for 
  192. PS/2s and Intel architecture machines is AIX 1.3; for PS/2s only, 1.2.1.
  193. For the RS/6000, there are two major levels, 3.1 and 3.2, and various
  194. intermediate levels.
  195.  
  196.  
  197. 1.01: I know neither Unix nor AIX - where do I find more information?
  198.  
  199. Quite a number of questions posted to comp.unix.aix show that AIX is
  200. people's first experience with Unix.  If this is the case with you, you
  201. are advised to look at the other newsgroups in the comp.unix hierarchy,
  202. in particular comp.unix.questions (for basic questions) or
  203. comp.unix.wizards (for difficult questions).  These two groups have a
  204. common FAQ posting as well.
  205.  
  206. If you need information about C programming, try comp.lang.c or comp.std.c,
  207. the latter for Standard ANSI C issues.  comp.lang.c has a FAQ posting.
  208.  
  209.  
  210. 1.02: I am used to Unix systems programming, why should I learn SMIT?
  211.  
  212. Using SMIT is probably very different from your normal way of doing
  213. system administration, but could prove very useful in the long run.  In
  214. some areas, in particular TCP/IP, NFS, etc., you also have the
  215. possibility of doing things the "normal" way, but it is unfortunately
  216. difficult to know exactly when the "normal" way works.  Again, always
  217. using SMIT, is probably your best way to go, even when you have to learn
  218. a new tool.
  219.  
  220. What SMIT actually does is to call a large number of specific tools for
  221. each part of the system administration.  The commands called and the
  222. output they produce are stored in the files smit.script and smit.log in
  223. your home directory.  Looking in smit.script may teach you more about
  224. system administration.
  225.  
  226.  
  227. 1.03: What is the Object Database?
  228.  
  229. The Object Database Manager, ODM, stored in /etc/objrepos,
  230. /usr/lib/objrepos, and /usr/share/lib/objrepos is AIX's way of storing
  231. all the system management information.  Under most circumstances, only
  232. SMIT or the commands SMIT call (see 1.02) should be used to change the
  233. ODM.
  234.  
  235. A harmless way to look at the ODM is to use odmget <Class> where <Class>
  236. is one of the files in /etc/objrepos.
  237.  
  238. The very interested user can use the ODM editor, odme, to navigate the
  239. ODM in detail.  Modifying the ODM should only be attempted if you know
  240. exactly what you are doing.
  241.  
  242.  
  243. 1.04: How do I get rid of the verbose error messages?
  244.  
  245. Many of the messages from the Unix commands are available in different
  246. languages.  This is controlled by the LANG environment variable, the
  247. default being En_US meaning English in the US.  All the default messages
  248. have a message number associated with them, e.g.:
  249.  
  250. $ cat no-such-file
  251. cat: 0652-050 Cannot open no-such-file.
  252.  
  253. If you prefer the terser Unix-looking error message, set your
  254. environment LANG to C, and you will get:
  255.  
  256. $ cat no-such-file
  257. cat: Cannot open no-such-file.
  258.  
  259.  
  260. 1.05: How do I make an informative prompt in the shell?
  261.  
  262. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  263. printed, so you can use:
  264.  
  265. $ myhost=`hostname`
  266. $ PS1='$LOGNAME@$myhost $PWD \$ '
  267.  
  268. to get, e.g. 
  269.  
  270. bengsig@ieibm1 /u/bengsig $
  271.  
  272. In the C-shell, use:
  273.  
  274. % set myhost=`hostname`
  275. % alias cd 'chdir \!*' > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  276. % cd
  277.  
  278. to get, e.g.
  279.  
  280. bengsig@dkunix9 /u/bengsig/aixfaq %
  281.  
  282. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  283.  
  284.  
  285. 1.06: How do I import an /etc/passwd or /etc/group file from another box?
  286.  
  287. Make sure that you run usrck and pwdck (/etc/passwd) and grpck
  288. (/etc/group) to let AIX work its password/group magic.
  289.  
  290.  
  291. 1.07: How do I put my own text into InfoExplorer?
  292.  
  293. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  294. InfoCrafter that allows you to do that.
  295.  
  296.  
  297. 1.08: Who has a termcap/terminfo source for the HFT console?
  298.  
  299. The console used on the RISC System/6000, PS/2 and RT can be used as a
  300. terminal on another system with the termcap below.  You can find this
  301. and other termcaps in /lib/libtermcap/termcap.src, including IBM
  302. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  303. This termcap can also be used from an aixterm window.
  304.  
  305. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  306.     :co#80:li#25:am:ht:\
  307.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  308.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  309.     :bs:sf=\E[S:ec=\E[%dX:\
  310.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  311.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  312.     :im=\E[4h:ei=\E[4l:mi:\
  313.     :dm=\E[4h:ed=\E[4l:\
  314.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  315.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  316.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  317.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  318.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  319.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  320.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  321.  
  322.  
  323. 1.09: Which release of AIX or other products do I have?
  324.  
  325. The command 'lslpp -h bos.obj' will show all lines referring to the BOS, 
  326. Basic Operating System.  E.g.:
  327.  
  328. Option Name          State      Event      Date      Release         User Name
  329.  
  330. -------------------- ---------- ---------- --------- --------------- ----------
  331. bos.obj              INACTIVE   COMMIT     02/03/90  03.01.0000.0000 root
  332.                      INACTIVE   APPLY      06/25/90  03.01.0000.0001 root
  333.                      INACTIVE   COMMIT     06/25/90  03.01.0000.0001 root
  334.                      INACTIVE   APPLY      11/16/90  03.01.0002.0015 root
  335.                      INACTIVE   COMMIT     11/16/90  03.01.0002.0015 root
  336.              ACTIVE     COMMIT     05/07/91  03.01.0005.0012 root
  337.  
  338. gives the history for the BOS lpp.  The last line, column four, indicates
  339. that this is release 3.1.5.
  340.  
  341. To see a listing of everything installed use lslpp -l '*', then use
  342. lslpp with the -h option as above to get a history of a particular lpp. 
  343.  
  344. Currently, 3.1.5 is considered the "base" release. Everyone should
  345. be at least at this level. Even though there are several intermediate
  346. ones, the official update is 2010. This should be what a customer
  347. would get if he/she made a ptf update request. If you are at some level
  348. earlier than 3.1.5, you must first apply 3.1.5, then 2010. Customers
  349. using SNA should request the SNA Quality Refresh update.
  350.  
  351. For AIX 3.2, it's a completely different scheme.  You may come across
  352. discussions on releases 3.2.0, 3.2.1, 3.2.2, 3.2.3 and 3.2.3 extended. 
  353. There is no absolute way to tell which of these you are running since
  354. the newer releases are simply 3.2.0 with some sets of PTFs added.  And
  355. since one can apply selective fixes it is possible that there could be
  356. many slightly different variations of 3.2 in use.  IBM is currently
  357. working on resolving this situation.  Please also see section 6.
  358.  
  359.  
  360. 1.10: Cleaning up utmp, who, and accounting problems
  361. From: fritz@scipp.UCSC.EDU (Frederick Staats)
  362.  
  363. This applies if you are running an X11R5 xterm on 3.2.
  364. Add this to the top of X11R5 mit/clients/xterm/main.c:
  365.  
  366. #ifdef AIXV3
  367. #define USE_SYSV_UTMP
  368. #define HAS_UTMP_UT_HOST
  369. #define WTMP_FILENAME "/var/adm/wtmp"
  370. #endif
  371.  
  372. And your utmp problems should go away.  If you want xterminal sessions
  373. to go into the wtmp file you need to define -DWTMP in the Imakefile and
  374. be sure the WTMP_FILENAME is set to the right place.
  375.  
  376. The following program by jfh@rpp386.cactus.org (John F. Haugh)
  377. if run in the background by root will clean up the utmp file.
  378.  
  379. #include <sys/types.h>
  380. #include <utmp.h>
  381. #include <fcntl.h>
  382.  
  383. main ()
  384. {
  385.     int    fd;
  386.     struct    utmp    utmp;
  387.  
  388.     while (1) {
  389.         if ((fd = open ("/etc/utmp", O_RDWR)) < 0)
  390.             exit (1);
  391.  
  392.         while (read (fd, &utmp, sizeof utmp) == sizeof utmp) {
  393.             if (utmp.ut_type == USER_PROCESS &&
  394.                     kill (utmp.ut_pid, 0) != 0) {
  395.                 lseek (fd, - (long) sizeof utmp, 1);
  396.                 utmp.ut_type = DEAD_PROCESS;
  397.                 write (fd, &utmp, sizeof utmp);
  398.             }
  399.         }
  400.         close (fd);
  401.         sleep (60);
  402.     }
  403. }
  404.  
  405. Another utmp program was posted to comp.sources.unix, volume 25, issue
  406. 96 by David W. Sanderson (dws@cs.wisc.edu) that also works on AIX 3.1.
  407.  
  408.  
  409. 1.11: Other hints, fsck of /, X-windows and ctrl-alt-backspace
  410.  
  411. Normally ctrl-alt-backspace will kill the X session.  If you add the
  412. -T option when initializing X, this will not happen.
  413.  
  414. You can run fsck either in maintenance mode or on mounted filesystems.
  415. To enter maintenance mode to run fsck on the root filesystem:
  416.  
  417.   1. boot from diskette
  418.   2. select maintenance mode
  419.   3. type /etc/continue hdisk0 exit (replace hdisk0 with boot disk if
  420.      not hdisk0)
  421.   4. fsck /dev/hd4
  422.  
  423.  
  424. 1.12: How do I shrink /usr?
  425. From: mike@bria.UUCP (Michael Stefanik) and Richard Hasting
  426.  
  427. FOR AIX 3.1
  428. -----------
  429.  
  430.  1) Make a backup of /usr
  431.  
  432.         find /usr -print | backup -ivf /dev/rmt0
  433.  
  434.     Use the appropriate tape device if it is not rmt0.
  435.  
  436.  2) shutdown to maintenance mode
  437.  
  438.         shutdown -Fm
  439.  
  440.  3) export LANG=C
  441.  
  442.  4) remove the filesystem and the logical volume
  443.     ignore an error about the "dspmsg" command not found
  444.  
  445.         umount /usr
  446.         rmfs /usr
  447.  
  448.  5) make a new logical volume hd2 and place it on rootvg with desired size
  449.  
  450.         mklv -yhd2 -a'e' rootvg NNN 
  451.  
  452.    where NNN is the number of 4 meg partitions
  453.  
  454.  6) create a filesystem on /dev/hd2
  455.  
  456.         crfs -vjfs -dhd2 -m'/usr' -Ayes -p'rw'
  457.  
  458.  7) mount the new /usr filesystem and check it
  459.  
  460.         /etc/mount /usr
  461.         df -v
  462.  
  463.  8) restore from the tape; system won't reboot otherwise
  464.  
  465.         restore -xvf/dev/rmt0
  466.  
  467.  9) Sync and reboot the system; you now have a smaller /usr filesystem
  468.  
  469. FOR AIX 3.2
  470. -----------
  471.  
  472.  1) Remove any unneeded files from /usr.
  473.  
  474.  2) Make sure all filesystems in the root volume group are mounted. If
  475.     not, they will not be included in the re-installed system.
  476.  
  477.  3) Type "mkszfile". This will create "/.fs.size" that contains a list
  478.     of the active filesystems in the root volume group that will be
  479.     included in the installation procedure.
  480.  
  481.  4) Edit .fs.size. Change the size of /usr to what you want.
  482.  
  483.     Example: This .fs.size file shows /usr to be 40MB.
  484.  
  485.                    rootvg 4 hd2 /usr 10 40 jfs
  486.  
  487.     The number 10 is the number of physical partitions for the filesystem
  488.     and the 40 is 40 MB. Most systems have a physical partition
  489.     size of 4 MB. Therefore, the second number (40) will always be
  490.     4 times the previous number (10). Note, however, that a model 320
  491.     with a 120 MB drive will have a physical partition size of only 2 MB,
  492.     and the total MB is therefore twice the number of physical partitions.
  493.     The first number (4) in the .fs.size file represents the PP size.
  494.  
  495.     If you want to reduce the size of /usr from 40 MB to 32 MB, 
  496.     edit the /usr entry to:
  497.  
  498.         rootvg 4 hd2 /usr 8 32 jfs
  499.  
  500.     IMPORTANT: Make sure that you DO NOT enter a value which is less
  501.     than the size of the filesystem required to contain the current
  502.     data. Doing so will cause the re-installation procedure to fail.
  503.  
  504.  5) chdev -l rmt0 -a block=512 -T
  505.  
  506.  6) Unmount all filesystems that are NOT in the root volume group.
  507.  
  508.  7) Varyoff all user-defined volume groups, if any
  509.  
  510.         varyoffvg VGname
  511.  
  512.  8) Export the user-defined volume groups, if any
  513.  
  514.         exportvg VGname
  515.  
  516.  9) With a tape in the tape drive, type
  517.  
  518.         mksysb /dev/rmt0
  519.  
  520.      This will do a complete system backup, which will include
  521.      information (in the .fs.size file) for the installation procedure
  522.      on how large the filesystems are to be created.
  523.  
  524.  10) Follow the instructions in the Installation Kit under "How to
  525.      Install and perform maintenance from Diskettes" using the
  526.      diskettes and tape that you created in the previous steps.
  527.      DO NOT select the option "Reinstall AIX with Current System
  528.      Settings" during the install procedure. The new system must be
  529.      installed using the option "Install AIX with Current System
  530.      Settings" for the logical volume size changes to take affect.
  531.  
  532.  11) When the operating system installation is complete, you may then
  533.      import the information into your newly installed operating system
  534.      for any user-defined volume groups.
  535.  
  536.          importvg -y VGname PVname
  537.  
  538.      where "VGname" is the name of the volume group, and "PVname" is
  539.      the name of any one of the physical volumes in the volume group.
  540.  
  541.  12) Varyon your user-defined volume groups
  542.  
  543.          varyonvg VGname
  544.  
  545.  The reduction of the filesystems is now complete.
  546.  
  547.  
  548. 1.13: How do I shrink the default paging space on hd6?
  549.  
  550. 1) create a paging space to use temporarily
  551.    mkps -s 20 -a rootvg
  552.  
  553. 2) change default paging space hd6 so it is not used at next reboot
  554.    chps -a n hd6
  555.  
  556. 3) For AIX 3.1, edit /etc/rc.boot4 and change swapon /dev/hd6;
  557.    for AIX 3.2, edit /sbin/rc.boot and change swapon /dev/hd6
  558.    swapon /dev/paging00
  559.  
  560. 4) Update information in boot logical volume
  561.    bosboot -a             (3.1)
  562.    bosboot -a -d hdisk0   (3.2)
  563.  
  564. 5) shutdown and reboot
  565.  
  566. 6) remove current hd6 and create a new one of smaller size
  567.    rmps hd6
  568.    mklv -y hd6 -t paging rootvg <size of PS in 4 Meg blocks>
  569.  
  570. 7) Re-edit /etc/rc.boot4 (3.1), /sbin/rc.boot (3.2) to swap to /dev/hd6
  571.    swapon /dev/hd6
  572.  
  573. 8) Update information in boot logical volume
  574.    bosboot -a             (3.1)
  575.    bosboot -a -d hdisk0   (3.2)
  576.  
  577. 9) change current paging device (paging00) so it is inactive at next boot
  578.    chps -a n /dev/paging00
  579.  
  580. 10) shutdown, reboot, remove paging00 using the command:
  581.     rmps paging00
  582.  
  583.  
  584. 1.14 How do I make a filesystem larger than 2 Gig?
  585.  
  586. The largest filesystem under AIX is 2 Gigabytes because the largest
  587. signed integer is 2**31 - 1.
  588.  
  589.  
  590. 1.15: How do I see/change system parameters like number of processes per user?
  591.  
  592. You can use SMIT as described below or simply use the lsattr/chdev pair. 
  593. The former will list the current setting as in:
  594.  
  595.   # lsattr -E -l sys0 -a maxuproc
  596.   maxuproc 40 Maximum # of processes allowed per user True
  597.  
  598. and you can then increase the maxuproc parameter:
  599.  
  600.   # chdev -l sys0 -a maxuproc=200
  601.   sys0 changed
  602.  
  603. If you just type 'lsattr -E -l sys0' you will get a list of all parameters,
  604. some of which can be changed - others not.
  605.  
  606. If you want to use smit, this procedure can be followed:
  607.  
  608. smit
  609.   System Environments and Processes
  610.     Change / Show Operating System Parameters
  611.       - on this screen you can change by overtyping the following fields:
  612.         - Maximum number of PROCESSES allowed per user
  613.         - Maximum number of pages in block I/O BUFFER CACHE
  614.         - Maximum Kbytes of real memory allowed for MBUFS
  615.       - toggle fields exist for:
  616.         - Automatically REBOOT system after a crash  (false/true)
  617.         - Continuously maintain DISK I/O history (true/false)
  618.  
  619.  
  620. 1.16: How can I unmount /usr to run fsck on it?
  621. From: accapadi@mathew.austin.ibm.com (Matt Accapadi)
  622. [ This is for 3.2. ]
  623.  
  624. In order to fsck /usr, it has to be unmounted.  But /usr cannot be
  625. unmounted because /bin is symbolically linked to /usr/bin.  Also
  626. /etc/fsck is symbolically linked to /usr/sbin/fsck.
  627.  
  628. To work around this, when you boot from the boot/maintenance diskettes
  629. and enter maintenance mode, enter "getrootfs hdisk0 sh" instead of
  630. "getrootfs hdisk0" where hdisk0 is the name of the boot disk.  Then run
  631. "fsck /dev/hd2".
  632.  
  633.  
  634. 1.17: The swapper seems to use extreme amount of paging space, why?
  635.  
  636. When you run ps, you may see a line like:
  637.  
  638. USER   PID %CPU %MEM    SZ   RSS     TT STAT  TIME CMD
  639. root     0 0.0%  14% 386528  8688      -    S 17:06 swapper
  640.  
  641. This is normal behavior, the swapper looks to ps like it has the entire
  642. paging space plus real memory allocated.
  643.  
  644.  
  645. 1.18: How much should I trust the ps memory reports?
  646. From: chukran@austin.VNET.IBM.COM
  647.  
  648. Using "ps vg" gives a per process tally of memory usage for each running
  649. process.  Several fields give memory usage in different units, but these
  650. numbers do not tell the whole story on where all the memory goes.
  651.  
  652. First of all, the man page for ps does not give an accurate description
  653. of the memory related fields.  Here is a better description:
  654.  
  655. RSS - This tells how much RAM resident memory is currently being used
  656. for the text and data segments for a particular process in units of
  657. kilobytes.  (this value will always be a multiple of 4 since memory is
  658. allocated in 4 KB pages).
  659.  
  660. %MEM - This is the fraction of RSS divided by the total size of RAM for
  661. a particular process.  Since RSS is some subset of the total resident
  662. memory usage for a process, the %MEM value will also be lower than actual.
  663.  
  664. TRS - This tells how much RAM resident memory is currently being used
  665. for the text segment for a particular process in units of kilobytes. 
  666. This will always be less than or equal to RSS.
  667.  
  668. SIZE - This tells how much paging space is allocated for this process
  669. for the text and data segments in units of kilobytes.  If the executable
  670. file is on a local filesystem, the page space usage for text is zero. 
  671. If the executable is on an NFS filesystem, the page space usage will be
  672. nonzero.  This number may be greater than RSS, or it may not, depending
  673. on how much of the process is paged in.  The reason RSS can be larger is
  674. that RSS counts text whereas SIZE does not.
  675.  
  676. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  677. and does not correlate to any of the other fields.
  678.  
  679. These fields only report on a process text and data segments.  Segment
  680. size which cannot be interrogated at this time are:
  681.  
  682.        Text portion of shared libraries (segment 13)
  683.  
  684.        Files that are in use. Open files are cached in memory as
  685.        individual segments.  The traditional kernel cache buffer
  686.        scheme is not used in AIX 3.
  687.  
  688.        Shared data segments created with shmat.
  689.  
  690.        Kernel segments such as kernel segment 0, kernel extension
  691.        segments, and virtual memory management segments.
  692.  
  693. Speaking of kernel segments, the %MEM and RSS report for process zero
  694. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  695. kernel segment zero is counted twice.  For AIX 3.2, this has been
  696. changed, but the whole story is still not known.  The RSS value for
  697. process 0 will report a very small number of the swapper private data
  698. segment.  It does not report the size of the kernel segment 0, where the
  699. swapper code lives.
  700.  
  701. In summary, ps is not a very good tool to measure system memory usage. 
  702. It can give you some idea where some of the memory goes, but it leaves
  703. too many questions unanswered about the total usage.
  704.  
  705.  
  706. 1.19 How do I mount a floppy disk as a filesystem?
  707. From: op@holmes.acc.Virginia.EDU (Olaf Pors)
  708.  
  709. You can build a filesystem on a floppy and mount it, however the
  710. filesystem will be read only.  The reason that the filesystem will be
  711. read only is because AIX Version 3.1.5 cannot create a journal log on a
  712. diskette.  The intended use is for temporary access to the read only
  713. data.  The diskette file system must be unmounted after use and during
  714. system backup procedures or errors could occur.
  715.  
  716. To make the read only filesystem on a floppy:
  717.  
  718. 1. Make a subdirectory on an existing filesystem on the hardfile, and
  719.    place all of the files that the diskette will contain into this
  720.    subdirectory.
  721.  
  722. 2. Enter the following command to create a prototype file containing
  723.    information about the new filesystem, in the example /dir_struct
  724.    is the pathname of the subdirectory created in step 1, and
  725.    proto_filename is the name of the prototype file to be created.
  726.  
  727.          proto /dir_struct > proto_filename
  728.  
  729. 3. Place your floppy disk into the drive and format it.
  730.  
  731. 4. Edit the prototype file and replace the first line with the following:
  732.  
  733.          <noboot> 0 0
  734.  
  735. 5. Enter the following command to make the filesystem on your floppy:
  736.  
  737.           mkfs -p proto_filename -V jfs /dev/fd0
  738.  
  739. 6. Create the directory upon which you will mount the floppy based
  740.    filesystem, or you can use the /mnt directory.  Enter the following
  741.    command to mount the filesystem:
  742.  
  743.           mount -r -V jfs /dev/fd0 /your_mount_point
  744.  
  745. 7. To unmount the filesystem, use the command:
  746.  
  747.           umount /dev/fd0
  748.  
  749. Since the filesystem is read-only it may be of limited use but if you
  750. are going to use it for utility programs and other data that does not
  751. change much, it still may be useful.  If you need to change the data,
  752. you can copy the directory from the floppy into another directory, make
  753. your modifications, and remake the filesystem using this procedure.
  754.  
  755.  
  756. 1.20  Some info about tape backups
  757. From: Craig Anderson
  758.  
  759. The following supplements the information on rmt devices in
  760. InfoExplorer.  It is based on my own personal experience with IBM tape
  761. drives running on AIX 3.1.  No warranty is expressed or implied.
  762.  
  763. CONFIGURING THROUGH SMIT:
  764.     BLOCK size (0=variable length)        (ALL)
  765.     Sets the tape block size.  When reading, the block size must be
  766.     set to the block size set when the tape was written.  When
  767.     using some commands, tapes written with ANY block size can be
  768.     read if the block size is set to 0 (variable length) (see
  769.     "BLOCK SIZES" below).
  770.  
  771.     Use DEVICE BUFFERS during writes        (ALL)
  772.     Set to yes, the device will buffer data internally on writes.
  773.     This greatly improves performance, but under certain cases may
  774.     be undesirable since the data is not written to tape before
  775.     returning a good indication.
  776.  
  777.     Use EXTENDED file marks            (8mm only)
  778.     Extended file marks take up much more space than short (or
  779.     non-extended) file marks.  But extended file marks can be
  780.     overwritten, allowing data not at the beginning of tape to be
  781.     overwritten (see "FILE MARKS" below).
  782.  
  783.     RETENSION on tape change or reset        (1/4" only)
  784.     If set to "no" then the tape will not be retentioned
  785.     automatically when the tape is inserted.  Note that this will
  786.     take effect only after the device is used.
  787.  
  788.  
  789. FILE MARKS:
  790.      Tape devices support multiple tape files.  Tape files are the
  791.      result of a backup/cpio/tar/dd type command, where the device is
  792.      opened, written to, and closed.  Because tapes allow large
  793.      quantities of data to be written on a single tape, several backups
  794.      (that is, tape files), may be combined on one physical tape.
  795.      Between each tape file is a "tape file mark" or simply "file
  796.      mark".  These file marks are used by the device driver to indicate
  797.      where one tape file ends and another begins.
  798.  
  799.                               B       E
  800.                    <-------   O       O   ------->
  801.                               T       T
  802.               __ ____________________________ _______________
  803.      physical | \            |       |      \             |physical
  804.      beginning|  \           | tape  |       \            | end
  805.        of     |   \          | file  |        \           |  of
  806.       tape    |    \         | mark  |         \          | tape
  807.               |_____\________|_______|__________\_________|
  808.  
  809.      Note that there is a distinction between the beginning of tape
  810.      (BOT) side of a file mark and the end of tape (EOT) side of a file
  811.      mark.  If the head is on the BOT side of a file- mark, "tctl fsf
  812.      1" command will move only to the EOT side of the same file mark.
  813.  
  814.      With the 1/4" tape drive, writing can only take place
  815.      sequentially, or after blank tape has been detected.  You cannot
  816.      write over data on the tape (except at BOT).  If you wish to add
  817.      data to a tape which has been written and then rewound you should
  818.      space forward file mark until an error occurs.  Only then can
  819.      you start writing again.
  820.  
  821.      With an 8mm tape drive, writing can only take place before blank
  822.      tape, an EXTENDED file mark, or at BOT.  Thus if several backups
  823.      have been made on one tape and you wish to overwrite one of the
  824.      backups, position the tape to the place you wish to start writing
  825.      and issue the following commands:
  826.     tctl bsf 1
  827.     tctl eof 1
  828.      The first command skips back to the BOT side of the same file
  829.      mark.  The second command rewrites the file mark (writing is
  830.      allowed before extended file marks).  The erase head will erase
  831.      data ahead of the write head, so that after writing the file mark
  832.      the head will be positioned before blank tape.  Only after this
  833.      may you start writing over data in the middle of the tape.  (All
  834.      data beyond where you are currently writing will be lost).  Note
  835.      that you cannot write over short file marks.  In order for this to
  836.      work, the tape must have been written with extended file marks
  837.      (use smit to change this).
  838.  
  839.      With the 9-track drive writing can take place anywhere on the
  840.      tape although overwriting single blocks of data is not supported.
  841.  
  842.      On the 8mm drive extended filemarks use 2.2 megabytes of tape and
  843.      can take up to 8.5 seconds to write.  Short filemarks use 184K
  844.      and take up to 1.5 seconds to write.
  845.  
  846. BLOCK SIZES:
  847.      When data is written to tape it is written in blocks.  The blocks
  848.      on a tape are separated by inter-record gaps.  It is important to
  849.      understand the structure of the written tape in order to
  850.      understand the problems which can occur with changing block
  851.      sizes.
  852.  
  853.      In fixed block size mode all blocks on the tape are the same
  854.      size.  They are the size of the block size set in the device
  855.      configuration.  All read()s and write()s to the tape drive must be
  856.      a multiple of the fixed block size.
  857.  
  858.      In fixed block mode a read() will return as many blocks as needed
  859.      to satisfy the read() request.  If a file mark is encountered
  860.      while reading the tape only the data up until the file mark will
  861.      be returned.
  862.  
  863.      It is not possible for the tape drive to read a tape whose block
  864.      size is not the same as the block size in the device
  865.      configuration.  (Unless the device configuration is in variable
  866.      size blocks.)
  867.  
  868.      In variable block size (0) mode, the blocks written on the tape
  869.      are the size of the read() and write() requests to the device
  870.      driver.  In this case, the actual block sizes on the tape can be
  871.      changed using the options to the backup commands (tar -C, cpio -C,
  872.      backup -C).
  873.  
  874.      In variable mode, read() requests greater than size of the block
  875.      on the tape will return only the data from the next block on the
  876.      tape.  It is this feature that allows tapes written in any block
  877.      size (fixed or variable) to read with the dd command (the output
  878.      from the dd command may be piped to restore, tar, or cpio for
  879.      example.)  Note that backup, tar, and cpio cannot read all tapes
  880.      by using a large block size because they assume there is an error
  881.      if they get a short read().
  882.         dd ibs=128k obs=16k if=/dev/rmt0 | ...
  883.  
  884.      The tape head is always positioned at an inter-record gap, file
  885.      mark, or blank tape after reading or writing.
  886.  
  887.      With the 8mm tape drive, using a fixed block size which is not a
  888.      multiple of 1K is inefficient.  The 8mm tape drive always writes
  889.      internally in 1K blocks.  It simulates the effect of variable
  890.      block sizes, but, for example, using a fixed block size of 512
  891.      bytes (or using variable block size and write()ing 512 bytes at a
  892.      time) wastes one half of the tape capacity and gives only one half
  893.      the maximum transfer rate.
  894.  
  895.  
  896. EXCHANGING DATA WITH NON-UNIX AND OTHER VENDORS MACHINES:
  897.      Many tape drives support both variable and fixed block sizes.
  898.  
  899.      Variable block mode writes block sizes the size of the write
  900.      command issued (tar and backup specify this with the -b option). 
  901.      In fixed mode, block sizes are fixed and all writes must be a
  902.      multiple of the fixed block size.
  903.  
  904.      Unix often internally chops larger reads and writes up into
  905.      manageable pieces (often 65535, 65534, or 65532 bytes) before
  906.      doing the actual reads and writes.  This means reads and writes of
  907.      64K bytes are often broken up into a 65535 byte record and a 1
  908.      byte record (In fixed mode the write will fail).  Block sizes >=
  909.      64K (-C128 and greater) should be avoided for this reason.  AIX
  910.      does not break up read and write requests, but be aware of the
  911.      situation on other machines.
  912.  
  913.      If the tape is written in an unknown block size then set the
  914.      device configuration in smit to use variable size blocks, use the
  915.      "dd" command with a large input block size, and pipe it to the
  916.      restore command.  For example:
  917.       chdev -l rmt0 -a block_size=0
  918.       dd if=/dev/rmt0 ibs=128k obs=16k | tar -tvf-
  919.  
  920.  
  921. 1.21: How do I do remote backup?
  922.  
  923. There seems to be several ways of doing this. I found the following works:
  924.  
  925.   tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
  926.  
  927.  
  928. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  929.  
  930. mksysb will not back up to remote tape devices. Frank provided the
  931. following script to do remote backups.
  932.  
  933. [Editor's note: I've verified this script works fine. However, it may be slow
  934.  for large filesystems since it creates a temp file of filenames in /tmp.]
  935.  
  936. #!/bin/ksh
  937. # @(#) Create a backup tape of the private user data.
  938. #=================================================================#
  939. #   Script :  usave.sh                                            #
  940. #   Author :  F. Kraemer                                          #
  941. #   Date   :  92/02/19                                            #
  942. #   Update :  92/10/29                                            #
  943. #   Info   :  the ultimative backup script                        #
  944. #   Example:  usave.sh /dev/rmt0      -  save to local tape       #
  945. #             usave.sh /save/save.me  -  save to local file       #
  946. #             usave.sh /tmp/pipe      -  save to remote tape      #
  947. #-----------------------------------------------------------------#
  948. PS4="(+) "
  949. #set -x
  950. PROG=$(basename $0)
  951. HOST=$(hostname)
  952. TODAY=$(date +%H:%M:%S)
  953. #-----------------------------------------------------------------#
  954. # cleanup                                                         #
  955. #-----------------------------------------------------------------#
  956. cleanup ()
  957. {
  958. ec=$1
  959. error=$2
  960. case "$ec"
  961. in
  962.    "$USAGE_EC")    # usage error
  963.      error="Usage:\t$PROG DeviceName\n" 1>&2
  964.     ;;
  965.    "$NOTAP_EC")    # Tape error
  966.      error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
  967.     ;;
  968.    "$LISTE_EC")    # list error
  969.      error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
  970.     ;;
  971.    "$NOTAR_EC")    # tar command error
  972.      error="error:\t$PROG: tar command failed.\n" 1>&2
  973.     ;;
  974.    "$PIPEP_EC")    # pipe error
  975.      error="error:\t$PROG: mknod command failed.\n" 1>&2
  976.     ;;
  977.    "$NORSH_EC")    # rsh error
  978.      error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
  979.     ;;
  980.    "$RHOST_EC")    # remote host error
  981.      error="error:\t$PROG: Remote Host unknown.\n" 1>&2
  982.     ;;
  983.    *)
  984.    ;;
  985. esac
  986. case "$DEVICE"
  987. in
  988.     #
  989.     # Fix the block size if $DEVICE is a tape device
  990.     #
  991.     /dev/rmt[0-9]*)
  992.         echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
  993.         tctl -f $DEVICE rewind 2>/dev/null
  994.         ;;
  995.     *) ;;
  996. esac
  997. rm -f ${LIST} ${PIPE} 2>/dev/null
  998. [ -n "$error" ] && echo "\n${error}\n"
  999. trap '' 0 1 2 15
  1000. exit "$ec"
  1001. }
  1002. #-----------------------------------------------------------------#
  1003. # Variables.                                                      #
  1004. #-----------------------------------------------------------------#
  1005. USAGE_EC=1                         # exit code for usage error
  1006. NOMNT_EC=2                         # exit code wrong device name
  1007. NOTAP_EC=3                         # exit code no tape available
  1008. LISTE_EC=4                         # exit code backup list error
  1009. NOTAR_EC=5                         # exit code for wrong tar
  1010. TRAPP_EC=6                         # exit code for trap
  1011. PIPEP_EC=7                         # exit code for pipe
  1012. RHOST_EC=8                         # exit code for bad ping
  1013. NORSH_EC=9                         # exit code for bad rsh
  1014. DEVICE="$1"                        # device to tar into
  1015. LIST="/tmp/.tar.$LOGNAME.$$"       #
  1016. REMOTEH=""                         # Remote host for backup
  1017. REMOTET=""                         # Remote tape for backup
  1018. tapedev=                           #
  1019. PIPE="/tmp/pipe"                   # Pipe for remote backup
  1020. #-----------------------------------------------------------------#
  1021. # main()                                                          #
  1022. #-----------------------------------------------------------------#
  1023. tput clear
  1024. echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
  1025. rm -f $LIST 2>/dev/null
  1026. #-----------------------------------------------------------------#
  1027. # Trap on exit/interrupt/break to clean up                        #
  1028. #-----------------------------------------------------------------#
  1029. trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
  1030. #-----------------------------------------------------------------#
  1031. # Check command options                                           #
  1032. #-----------------------------------------------------------------#
  1033. [ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
  1034. #-----------------------------------------------------------------#
  1035. # Check device name                                               #
  1036. #-----------------------------------------------------------------#
  1037. [ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
  1038.         "$PROG: Backup device or file name must start with a '/'."
  1039. #-----------------------------------------------------------------#
  1040. # Check tape device.                                              #
  1041. #-----------------------------------------------------------------#
  1042. case "$DEVICE"
  1043. in
  1044.     #
  1045.     # Fix the block size if $DEVICE is a tape device
  1046.     #
  1047.     /dev/rmt[0-9]*)
  1048.         #
  1049.         echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
  1050.         #
  1051.         # see if a low or high density tape device was specified
  1052.         # (eg rmt0.1)
  1053.         density="`expr $DEVICE : \
  1054.                 "/dev/rmt[0-9]*\.\([0-9]*\)"`"
  1055.         #
  1056.         # strip /dev/ from device name and
  1057.         # get the base name (eg translate:
  1058.         # /dev/rmt0.2 to rmt0)
  1059.         #
  1060.         tapedev="`expr $DEVICE : \
  1061.                 "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
  1062.         #
  1063.         # Check if the tape is defined in the system.
  1064.         lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
  1065.         rc=$?
  1066.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  1067.         #
  1068.         # Restore old tape name.
  1069.         #
  1070.         [ "${density:-1}" -lt 4 ] && density=1 || density=5
  1071.         DEVICE="/dev/${tapedev}.${density}"
  1072.         echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
  1073.         read TEMP
  1074.         echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
  1075.         tctl -f $DEVICE rewind 2>/dev/null
  1076.         ;;
  1077.     #
  1078.     # Backup is done on remote host. The remote shell facility
  1079.     # must be set up and running.
  1080.     #
  1081.     ${PIPE}*)
  1082.         #
  1083.         echo "\n\t$PROG: Assuming remote backup via network.\n"
  1084.         echo "\t$PROG: Enter name of Remote Host   ===> \c"
  1085.         read REMOTEH
  1086.         echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
  1087.         ping ${REMOTEH} 1 1 >/dev/null 2>&1
  1088.         rc=$?                                    # give up unknown host
  1089.         [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
  1090.         JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
  1091.         rc=$?                                    # give up rsh failed
  1092.         [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
  1093.         echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
  1094.         echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
  1095.         read REMOTET
  1096.         echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(press enter)"
  1097.         read TEMP
  1098.         echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
  1099.         rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
  1100.         rc=$?                                    # give up rsh failed
  1101.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  1102.         rm -f ${PIPE} 2>/dev/null
  1103.         mknod ${PIPE} p
  1104.         rc=$?                                    # give up mknod failed
  1105.         [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
  1106.         cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
  1107.         ;;
  1108.     *)  ;;
  1109. esac
  1110. #-----------------------------------------------------------------#
  1111. # Prepare the list.                                               #
  1112. #-----------------------------------------------------------------#
  1113. echo "\n\t$PROG: Create list of files to be saved...."
  1114. find $HOME -print > $LIST
  1115. rc=$?
  1116. [ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
  1117. #-----------------------------------------------------------------#
  1118. # tar the files.                                                  #
  1119. #-----------------------------------------------------------------#
  1120. echo "\n\t$PROG: Changing current directory to (/)...."
  1121. cd / > /dev/null 2>&1
  1122. echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
  1123. tar -cvf "$DEVICE" -L "$LIST"
  1124. rc="$?"
  1125. [ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
  1126. #-----------------------------------------------------------------#
  1127. # Backup completed                                                #
  1128. #-----------------------------------------------------------------#
  1129. TODAY=$(date +%H:%M:%S)
  1130. echo "\n\t$PROG ended at $TODAY............................\n\n"
  1131. cleanup 0
  1132. #-----------------------------------------------------------------#
  1133. # EOF                                                             #
  1134. #-----------------------------------------------------------------#
  1135.  
  1136.  
  1137. 1.22: How do I backup a multi-disk volume group?
  1138. From: pack@acd.ucar.edu (Daniel Packman)
  1139.  
  1140. [ Editor's note: I have not verified this procedure.  I would actually
  1141.   recommend NOT to have one volume group span multiple disks unless you
  1142.   really need such big logical volumes. ]
  1143.  
  1144.   1. If you have a set of three or more disks in a volume group.
  1145.      (typically 3 for 5xx machines with three internal drives;
  1146.      with only two, the procedures outlined here have to be modified
  1147.      to ignore the fact that you don't have a quorum in the volume group)
  1148.  
  1149.   2. If one drive has failed (usually only one fails at a time :-) )
  1150.  
  1151. It is possible to go through a service boot and (if we say the volume
  1152. group is called rootvg and one of the 2 good disks on it is called hdisk0):
  1153.  
  1154.   importvg -y rootvg hdisk0
  1155.   varyonvg -f -n -m1 rootvg
  1156.  
  1157. These commands will work, but give error messages.  If you wish to mount
  1158. a user filesystem, say /u on logical volume /dev/lv00, then
  1159.  
  1160.   mount -f /dev/lv00 /v
  1161.  
  1162. will work only if the jfslog, the journaled file system log device, is not
  1163. on the damaged disk.  If it is, you must (and can in any case) mount the
  1164. filesystem read-only:
  1165.  
  1166.   mount -f -r /dev/lv00 /v
  1167.  
  1168. This crucial and rather obvious point baffled several level 3 support
  1169. personnel at Austin as well as myself for almost a week.  Once the file
  1170. system(s) of interest are available, then they can be saved to tape for
  1171. restoration later.  Of course, one can expect only about two thirds of a
  1172. filesystem to be recoverable if it spans all 3 physical disks.  One
  1173. other point to remember is that the standard boot procedure from floppy
  1174. includes the restore command but does not include the backup command. 
  1175.  
  1176. *****************************************************************************
  1177. * If you do not have other RS6000 machines at your site is is imperative    * 
  1178. * that you either build a bootable tape which includes either restore or    * 
  1179. * tar or cpio (a bootable floppy set will not have enough space) or at the  *
  1180. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
  1181. * should be created with backup -ivq so that its contents can be read into  *
  1182. * the memory resident system after booting.                                 *
  1183. *****************************************************************************
  1184.  
  1185. All is not lost if tar, cpio or backup are available on an undamaged
  1186. disk that can be mounted.  Since tar and cpio are in /bin, they may both
  1187. very well be unavailable.
  1188.  
  1189. It is a very good idea for those who have tape devices to build a
  1190. bootable tape with their desired extra commands in it.  Follow the
  1191. instructions from IBM but add your desired commands to the following
  1192. three files:
  1193.  
  1194.     /usr/lpp/bosinst/tape2
  1195.     /usr/lpp/bosinst/diskette/boot2
  1196.     /usr/lpp/bosinst/diskette/inslist
  1197.  
  1198. If you have anything other than a minimum memory configuration, you
  1199. should be able to add many commands.
  1200.  
  1201.  
  1202. 1.23: How do I put multiple backups on a single 8mm tape?
  1203. From: kerm@mcnc.org (Cary E. Burnette)
  1204.  
  1205. There are two possible solutions to this, which both use the /dev/rmt0.1
  1206. device which is non-rewinding.
  1207.  
  1208. SOLUTION #1
  1209. -----------
  1210.  
  1211. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  1212. no-rewind device, using either rdump or backup (both by name & inode
  1213. work).  Using rdump or backup "byinode" both generate the message that
  1214. the tape is rewinding but actually do not.  This is an example that
  1215. would work on my system:
  1216.  
  1217. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  1218. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  1219. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  1220.  
  1221. where I am implementing the command from host.
  1222. To restore a table of contents of the first I would use 
  1223.  
  1224. # restore -f /dev/rmt0.1 -s1 -tv
  1225.  
  1226. where the -s1 flag tells restore to go to the first record it comes
  1227. across on the tape.  To get the second type in exactly the same once
  1228. again.  Basically -s(Number) stands for - go to Number record from this
  1229. spot.  It works pretty well.
  1230.  
  1231.  
  1232. SOLUTION #2
  1233. -----------
  1234.  
  1235. Steve Knodle
  1236. Educational Resources Center
  1237. Clarkson University
  1238.  
  1239. I use:
  1240. ------------------- Dump.sh --------------------
  1241. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  1242. set -x
  1243. LEVEL=$1
  1244. shift
  1245.  
  1246. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  1247. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  1248. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  1249. tctl -f /dev/rmt0 rewind
  1250.  
  1251. touch /usr/local/dumps/Contents.$CONTENTSFILE
  1252. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1253. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1254. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1255. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1256. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  1257. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  1258. tctl -f /dev/rmt0 rewind
  1259.  
  1260. I process the table-of-contents first by a little program that does
  1261. common prefix encoding, and then compress.
  1262.  
  1263. This gives a table of contents file I can keep on-line until the tape
  1264. is reused.
  1265.  
  1266.  
  1267. 1.24: How do I remove a committed lpp?
  1268. From: drb@chmeds.ac.nz (Ross Boswell)
  1269.  
  1270. This seems to be a common problem.  I got the following script from IBM
  1271. NZ AIX software support.  As far as I know, it works -- I used it to
  1272. remove unwanted fonts.  I have no official permission to post it -- use
  1273. it at your own risk! This script only works on AIX 3.2.
  1274.  
  1275. #!/bin/ksh
  1276. #
  1277. # Permanently remove a product from disk and AIX databases
  1278. #
  1279.  
  1280. if [ `whoami` != "root" ] ; then
  1281.   echo You must be root to run this script.
  1282.   exit 1
  1283. fi
  1284.  
  1285. if [ `uname -a | awk '{print $1$4$3}'` != "AIX32" ] ; then
  1286.   echo This script only works on AIX 3.2.
  1287.   exit 1
  1288. fi
  1289.  
  1290. TMP_FREE=`df /tmp | awk '$3 ~ /[0-9]/{print $3}'`
  1291. if [ "$TMP_FREE" -lt 1000 ] ; then
  1292.    echo There is not enough room in your /tmp directory.
  1293.    echo You need 1000 KB free, and you have only $TMP_FREE KB free.
  1294.    echo Either remove some stuff from /tmp, or use chfs to make it bigger.
  1295.    exit 1
  1296. fi
  1297.  
  1298. ODMDIRS="/etc/objrepos /usr/lib/objrepos /usr/share/lib/objrepos"
  1299. ODMDIR=/usr/lib/objrepos
  1300. export ODMDIR
  1301.  
  1302. if [ $# -lt 1 ]
  1303. then
  1304.   echo usage: $0 lppname [lppname ...]
  1305.   echo lppname is a string compatible with grep, ie "X11" or "PHIGS"
  1306.   echo typing   $0 PHIGS   will remove all LPPs with PHIGS in their name.
  1307.   exit 1
  1308. fi
  1309.  
  1310. NAMES=$1
  1311. shift
  1312. while [ $# -gt 0 ] ; do
  1313.   NAMES="$NAMES|$1"
  1314.   shift
  1315. done
  1316. echo "Searching for lpps with egrep \"$NAMES\"...\c"
  1317.  
  1318. for ODMDIR in $ODMDIRS ; do
  1319.   if [ ! -d $ODMDIR -o ! -w $ODMDIR ] ; then
  1320.      echo $ODMDIR is not writeable or is not a directory.
  1321.      echo I hope this is because you are a /usr client or diskless.
  1322.      echo If you are not a diskless or a /usr client, you should stop.
  1323.      echo "Enter y to continue ->\c"
  1324.      read answer
  1325.      if [ "$answer" != "y" ] ; then
  1326.        exit 0
  1327.      fi 
  1328.   fi
  1329.   TMP=`odmget lpp | awk -F\" '/name/ {print $2}' | egrep "$NAMES"`
  1330.   LPPS=`echo $LPPS $TMP`
  1331. done
  1332.  
  1333. if [ "$LPPS" = "" ]
  1334. then
  1335.   echo "failed.\nNo LPP with the name $NAMES detected."
  1336.   exit 1
  1337. fi
  1338. echo ok.
  1339.  
  1340. for ODMDIR in $ODMDIRS ; do
  1341.   mkdir -p /tmp/rmlpp/$ODMDIR > /dev/null 2>&1
  1342. done
  1343.  
  1344. > /tmp/listOfFilesToRM$$    # truncate temporary file, just in case.
  1345. echo
  1346. echo This script is about to attempt to remove an LPP from your system.
  1347. echo I say attempt, because it could fail.  If it fails, you may have
  1348. echo to at least reload the LPP.  Use the \"lppchk\" command to make sure
  1349. echo all is well with your system.
  1350. echo
  1351. # Loop through all the LPP names found.
  1352. for LPP in $LPPS
  1353. do
  1354.   DESCR=none
  1355.   answer=""
  1356.  
  1357.   # find the LPP ids.  They will be different in the three SWVPD databases.
  1358.   for ODMDIR in $ODMDIRS ; do
  1359.     # get the lpp id for this ODMDIR (yes, they are different)
  1360.     LPPID=`odmget -q name=$LPP lpp | grep lpp_id | sed 's/.* = //'`
  1361.  
  1362.     # did we find the LPP?
  1363.     if [ "$DESCR" = "none" -a "$LPPID" != ""  ] ; then
  1364.       # all the descriptions should be the same
  1365.       DESCR=`odmget -q name=$LPP lpp | grep description | sed 's/.* = //'`
  1366.       echo "Delete $LPP, $DESCR?"
  1367.       echo "y or (n) ->\c"
  1368.       read answer
  1369.       if [ "$answer" != "y" ] ; then # jump back up to the next LPP name
  1370.         continue 2
  1371.       fi
  1372.     fi
  1373.     # if there is no DESCR, then we didn't find the LPP.  Weird.
  1374.     if [ "$DESCR" = "none" -o "$LPPID" = "" ] ; then
  1375.       continue
  1376.     fi
  1377.     SOMETHING_DONE_FLAG=true
  1378.     # Optionally, save the ODM stuff we are about to remove,
  1379.     # in case something goes wrong.  The problem is it is difficult
  1380.     # to determine if something really did fail, since these commands
  1381.     # don't return any decent error return codes.
  1382.     odmget -q lpp_id=$LPPID history   > /tmp/rmlpp/$ODMDIR/$LPP.history
  1383.     odmget -q name=$LPP lpp           > /tmp/rmlpp/$ODMDIR/$LPP.lpp
  1384.     odmget -q lpp_name=$LPP product   > /tmp/rmlpp/$ODMDIR/$LPP.product
  1385.     # Get the list of files and links to remove later....
  1386.     odmget -q lpp_id=$LPPID inventory > /tmp/rmlpp/$ODMDIR/$LPP.inventory
  1387.     awk -F\" '/loc/ {print $2}' /tmp/rmlpp/$ODMDIR/$LPP.inventory | \
  1388.       sed 's/,/ /g' >> /tmp/listOfFilesToRM$$
  1389.     odmdelete -o history -q lpp_id=$LPPID   > /dev/null 2>&1
  1390.     odmdelete -o lpp -q name=$LPP           > /dev/null 2>&1
  1391.     odmdelete -o product -q lpp_name=$LPP   > /dev/null 2>&1
  1392.     odmdelete -o inventory -q lpp_id=$LPPID > /dev/null 2>&1
  1393.   done
  1394. done
  1395.  
  1396. if [ "$SOMETHING_DONE_FLAG" = "true" ] ; then
  1397.  
  1398.   echo ODM work is done.  Now, time to delete files....
  1399.  
  1400.   # This could be catastrophic if there is a problem.  For example,
  1401.   # if the ODM database for an application had / as one of its files.
  1402.   # You be the judge.  Here's your rope....
  1403.   cat /tmp/listOfFilesToRM$$ | sort -r | uniq | xargs rm -rf
  1404.  
  1405.   rm -rf /tmp/listOfFilesToRM$$
  1406.   echo done.
  1407. fi
  1408.  
  1409. # take this line out if you want to save your ODM saved files.
  1410. rm -rf /tmp/rmlpp
  1411.  
  1412. exit 0
  1413.  
  1414.  
  1415. 1.25: My named dies frequently, why?
  1416.  
  1417. Running on 3.2, named dies frequently on network's primary name server.
  1418.  
  1419. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  1420.  
  1421. Try the following:
  1422.  
  1423.      stopsrc -s named        # stop running named
  1424.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  1425.      /etc/named ...        # don't use smit to start named
  1426.  
  1427. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  1428. the same effect, but I'm not sure.
  1429.  
  1430. [According to John, the problem is malloc() in the named code. He
  1431.  also suggests using Berkeley's bind, which he has ported and can be
  1432.  ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
  1433.  
  1434. Two ptfs should fix this problem. Get U412332 and U414752.
  1435.  
  1436.  
  1437. 1.26: How do I trace ethernet packets on an AIX system?
  1438. From: afx@muc.ibm.de (Andreas Siegert)
  1439.  
  1440. Do the following:
  1441.  
  1442.      iptrace -i en0 /tmp/ipt
  1443.  
  1444. The iptrace backgrounds.  Find its process id and kill it when you are
  1445. ready.  Then run
  1446.  
  1447.      ipreport -rns /tmp/ipt >/tmp/ipr
  1448.  
  1449. and look at the output.  The current version of Info does not document
  1450. the r, n and s options but they are quite useful for layering the output.
  1451.  
  1452.  
  1453. 1.27: How can I look at PostScript files?  Why is "dpsexec" so lousy?
  1454. From: VRBASS@ATLVMIC1 (Vance R. Bass)
  1455.  
  1456. You can look at PostScript files using either "xpreview" (which
  1457. comes with the operating system in the optionally installable text
  1458. formatting services) or you can get GhostScript and GhostView from a
  1459. comp.sources.x server and build it yourself.
  1460.  
  1461. >From the "xpreview" man page:
  1462. The xpreview command is an AIXwindows 1.2- and Motif 1.1-based application
  1463. that displays output from the troff command on an AIXwindows display. The
  1464. The troff command output file must be prepared for any one of the devX100,
  1465. devX100K or devpsc devices. The xpreview command also displays PostScript
  1466. language files that begin with %! (percent sign and exclamation mark).
  1467.  
  1468. "dpsexec" is NOT intended to be a full-service document browser, but
  1469. rather a simple DPS code debugger.  If you insist on using it, you can
  1470. edit your PS code to remove the "showpage" (which will reset dpsexec
  1471. and clear the window) to view single-page files.  It does not handle
  1472. multi-page files gracefully.
  1473.  
  1474.  
  1475. 1.28 What is the authorized way of starting automount at boot time?
  1476. From: curt@ekhadafi.austin.ibm.com (Curt Finch)
  1477.  
  1478. I put this in my /etc/inittab:
  1479.  
  1480. automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
  1481.  
  1482. I hereby dub it authorized.
  1483.  
  1484.  
  1485. 1.29 InfoExplorer ASCII key bindings 
  1486. From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
  1487.  
  1488. If you just press `Return' when it starts up, with `Basic Screen
  1489. Operations' highlighted, you'll get some help.
  1490.  
  1491. If you look long enough, you'll find a page named `Using Keys and Key
  1492. Sequences in the InfoExplorer ASCII Interface'.  It should describe 
  1493. of the key sequences and actions. Here are a few to get you started.
  1494.  
  1495. Keys       Action
  1496.  
  1497. Ctrl-W     Moves between the Navigation screen and the Reading screen.
  1498. If the Navigation screen is displayed, you can press the Ctrl-W key
  1499. sequence to display the Reading screen.  If the Reading screen is
  1500. displayed, you can press the Ctrl-W key sequence to display the
  1501. Navigation screen.
  1502.  
  1503. Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
  1504. located in the text area of the screen, you can press the Ctrl-O key
  1505. sequence to make the menu bar active.  If the menu bar is already
  1506. active, you can press the Ctrl-O key sequence to make it inactive, which
  1507. moves the text cursor to the text area.
  1508.  
  1509. Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
  1510. menu is not displayed and you press the Right Arrow key, the next menu
  1511. bar option is displayed in reverse video.
  1512.  
  1513.  
  1514. 1.30: Listing files with ls causes a core dump
  1515. From: jfh@greenber.austin.ibm.com (John F Haugh II)
  1516.  
  1517. Scenario: a directory that is shared by N users (N >= 200).
  1518. Run 'ls -l' in that directory.  It goes for a while, then
  1519. Seg fault(coredump)!
  1520. It only occurs when the usernames are displayed (almost every file 
  1521. is owned by a different person).  The -g and -n options work fine;
  1522. only -l and -o (which shows owner and not group) cause it.
  1523.  
  1524. I believe that this problem was corrected by U407548.
  1525. If you have that many users that you are having core dump problems (it
  1526. took over 200 ...), you might also want to look into getting the PTF
  1527. that fixes IX31403.  That APAR deals with large numbers of accounts and
  1528. performance problems associated with looking them up.
  1529.  
  1530.  
  1531. 1.31: Where are the AIX log files kept?
  1532. From: dirk@kimosabi.ucsc.edu (Dirk Coldewey)
  1533.  
  1534. Such as the equivalent of the SunOS file '/var/log/syslog' and 
  1535. '/var/adm/messages'.
  1536.  
  1537. If you want regular unix syslog files, you can configure syslogd
  1538. in /etc/syslog.conf.  Here's the one that I use:
  1539.  
  1540. #
  1541. # See the supplied /etc/syslog.conf file for copious comments.
  1542. #
  1543. *.err;kern.debug;auth.notice;user.none          /dev/console
  1544. *.err;kern.debug;daemon,auth.notice;mail.crit;user.none /var/adm/messages
  1545. lpr.debug                                       /var/adm/lpd-errs
  1546.  
  1547. *.alert;kern.err;daemon.err;user.none           operator
  1548. *.alert;user.none                               root
  1549.  
  1550. *.emerg;user.none                               *
  1551.  
  1552. # for loghost machines, to have authentication messages (su, login, etc.)
  1553. # logged to a file, un-comment out the following line and adjust the 
  1554. # file name as appropriate.
  1555. #
  1556. # if a non-loghost machine chooses to have such messages 
  1557. # sent to the loghost machine, un-comment out the following line.
  1558. #
  1559. auth.notice                     /var/log/authlog
  1560.  
  1561. mail.debug                      /var/log/syslog
  1562.  
  1563. # following line for compatibility with old sendmails.  they will send
  1564. # messages with no facility code, which will be turned into "user" messages
  1565. # by the local syslog daemon.  only the "loghost" machine needs the following
  1566. # line, to cause these old sendmail log messages to be logged in the
  1567. # mail syslog file.
  1568. #
  1569. user.alert                                      /var/log/syslog
  1570. #
  1571. # non-loghost machines will use the following lines to cause "user"
  1572. # log messages to be logged locally.
  1573. #
  1574. user.err                                        /dev/console
  1575. user.err                                        /var/adm/messages
  1576. user.alert                                      `root, operator'
  1577. user.emerg                                      *
  1578.  
  1579.  
  1580. 1.32: Two srcmstr's are less useful than one?
  1581. From: hubert@rs530.ncs.mainz.ibm.com (Bernhard Zeller)
  1582.  
  1583. This can happen on systems that have no console, or systems with an
  1584. async terminal as the console but not attached or turned off.  One of the
  1585. symptoms is a second srcmstr got run.  But the second srcmstr is worthless
  1586. as we can't use the stop/startsrc commands, refresh inetd, qdaemon won't
  1587. start, etc.  
  1588.  
  1589. To resolve this, type:
  1590.  
  1591.     smit chgtty
  1592.  
  1593. and add the keyword 'clocal' in following lines:
  1594.  
  1595.    STTY attributes for RUN TIME
  1596.    STTY attributes for LOGIN
  1597.  
  1598.  
  1599. 1.33: Where can I find tools for performance monitoring?
  1600.  
  1601. For 3.2 a few tools are available in /usr/lpp/bosperf.  There are tools
  1602. to monitor traces, I/O events, CPU, virtual memory, disk block usage,
  1603. kernel extensions, etc. It even has a simulator, rmss, that allows one
  1604. to try out different memory size configurations to see how it impacts
  1605. performance.  See 6.06 about the AIX Performance and Tuning Guide.
  1606.  
  1607.  
  1608. 1.34: How do I set a tty port for both dial-in and dial-out?
  1609.  
  1610. Set the mode of the tty to be either 'shared' or 'delayed'. 
  1611.  
  1612.  
  1613. 1.35: SCSI-1 and SCSI-2 "interoperability" got you confused?
  1614. From: drr
  1615.  
  1616. A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
  1617.     config will provide SCSI-1 performance.
  1618.  
  1619. B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
  1620.     config will provide SCSI-1 performance.
  1621.  
  1622. C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
  1623.     adapter.  All devices will have SCSI-1 performance.
  1624.  
  1625. D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
  1626.     adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
  1627.     and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).
  1628.  
  1629.  
  1630. 1.36: How to move or copy whole directory trees across a network
  1631.  
  1632. The following command will move an entire directory tree across a network 
  1633. while preserving permissions, uids and gids.
  1634.  
  1635.       $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
  1636.  
  1637. Explanation:
  1638.  
  1639. The tar-create is rsh'd to the remote system and is written to
  1640. stdout (the pipe).
  1641.  
  1642. The local system is extracting the tar that is being read from
  1643. stdin (the pipe).
  1644.  
  1645.  
  1646. 1.37: How to get your keyboard back after unplugging it from the 6000
  1647. From: Mickey Coggins and Anne Serre
  1648.  
  1649. When you unplug your keyboard from a running system, and plug it back
  1650. in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
  1651. don't work as designed.
  1652.  
  1653. Solution: Type at the command line
  1654.  
  1655.         /usr/lpp/diagnostics/da/dkbd
  1656.  
  1657. Your screen goes black, you hear a few beeps, and your keyboard is reset.
  1658. It works with any environment, Xwindows, hft, NLS...
  1659.  
  1660.  
  1661. 1.38: How do I set up ksh for emacs mode command line editing?
  1662. From: scotte@cdsac.uucp (L. Scott Emmons)
  1663.  
  1664. The ksh has an undocumented way of binding the arrowkeys to the emacs
  1665. line editing commands. In your .kshrc, add:
  1666.  
  1667. alias __A=^P
  1668. alias __B=^N
  1669. alias __C=^F
  1670. alias __D=^B
  1671. alias __H=^A
  1672.  
  1673. Note that "^P" (et al) must be the actual control sequence.
  1674.  
  1675. Type "set -o emacs" or put this line in your .profile.
  1676.  
  1677. Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
  1678. for the problem is IX25982, which may have been superceeded.
  1679.  
  1680.  
  1681. 1.39: How can I tell what virtual printer a print queue is using?
  1682. From: yoder@austin.ibm.com (Stuart R. Yoder)
  1683.  
  1684. Use the command 'lsvirprt'.  Don't use any parameters and it will
  1685. run in an interactive mode that will give you a menu of all virtual
  1686. printers on the system with the queue and device for each one.
  1687.  
  1688. -- 
  1689. Luis Basto
  1690. Computer Sciences Corporation
  1691. Internet: basto@cactus.org
  1692. Usenet:   cs.utexas.edu!mavrick!luis
  1693.